Global Index
HTML5 JS API Index > DOM Tutorials & Specs

HTMLTableElement

Extends HTMLElement.

The table element represents data with more than one dimension, in the form of a table.

Properties
HTMLTableCaptionElement?
caption
The caption IDL attribute must return, on getting, the first caption element child of the table element, if any, or null otherwise. On setting, the first caption element child of the table element, if any, must be removed, and the new value, if not null, must be inserted as the first node of the table element.
HTMLCollection
rows
The rows attribute must return an HTMLCollection rooted at the table node, whose filter matches only tr elements that are either children of the table element, or children of thead, tbody, or tfoot elements that are themselves children of the table element.
boolean
sortable
The IDL attribute sortable must reflect the sortable content attribute.
HTMLCollection
tBodies
The tBodies attribute must return an HTMLCollection rooted at the table node, whose filter matches only tbody elements that are children of the table element.
HTMLTableSectionElement?
tFoot
The tFoot IDL attribute must return, on getting, the first tfoot element child of the table element, if any, or null otherwise. On setting, if the new value is null or a tfoot element, the first tfoot element child of the table element, if any, must be removed, and the new value, if not null, must be inserted immediately before the first element in the table element that is neither a caption element, a colgroup element, nor a thead element, if any, or at the end of the table if there are no such elements.
HTMLTableSectionElement?
tHead
The tHead IDL attribute must return, on getting, the first thead element child of the table element, if any, or null otherwise. On setting, if the new value is null or a thead element, the first thead element child of the table element, if any, must be removed, and the new value, if not null, must be inserted immediately before the first element in the table element that is neither a caption element nor a colgroup element, if any, or at the end of the table if there are no such elements.
Operations
HTMLElement
createCaption()
The createCaption() method must return the first caption element child of the table element, if any; otherwise a new caption element must be created, inserted as the first node of the table element, and then returned.
HTMLElement
createTBody()
The createTBody() method must create a new tbody element, insert it immediately after the last tbody element child in the table element, if any, or at the end of the table element if the table element has no tbody element children, and then must return the new tbody element.
HTMLElement
createTFoot()
The createTFoot() method must return the first tfoot element child of the table element, if any; otherwise a new tfoot element must be created and inserted immediately before the first element in the table element that is neither a caption element, a colgroup element, nor a thead element, if any, or at the end of the table if there are no such elements, and then that new element must be returned.
HTMLElement
createTHead()
The createTHead() method must return the first thead element child of the table element, if any; otherwise a new thead element must be created and inserted immediately before the first element in the table element that is neither a caption element nor a colgroup element, if any, or at the end of the table if there are no such elements, and then that new element must be returned.
void
deleteCaption()
The deleteCaption() method must remove the first caption element child of the table element, if any.
voiddeleteRow(long index)
void
deleteTFoot()
The deleteTFoot() method must remove the first tfoot element child of the table element, if any.
void
deleteTHead()
The deleteTHead() method must remove the first thead element child of the table element, if any.
HTMLElement
insertRow(optional long index)
The behavior of the insertRow(index) method depends on the state of the table.
void
stopSorting()
The table element's stopSorting() method, when invoked, must remove the sorted attribute of all the sorting-enabled th elements of the table element on which the method was invoked.